package com.wms.function.service.impl;

import java.util.List;
        import com.wms.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wms.function.mapper.TbReservoirAreaMapper;
import com.wms.function.domain.TbReservoirArea;
import com.wms.function.service.ITbReservoirAreaService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Arrays;

/**
 * 库区设置Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-21
 */
@Service
public class TbReservoirAreaServiceImpl extends ServiceImpl<TbReservoirAreaMapper,TbReservoirArea> implements ITbReservoirAreaService {
    @Autowired
    private TbReservoirAreaMapper tbReservoirAreaMapper;

    /**
     * 查询库区设置
     *
     * @param id 库区设置主键
     * @return 库区设置
     */
    @Override
    public TbReservoirArea selectTbReservoirAreaById(Long id) {
                return getById(id);
    }

    /**
     * 查询库区设置列表
     *
     * @param tbReservoirArea 库区设置
     * @return 库区设置
     */
    @Override
    public List<TbReservoirArea> selectTbReservoirAreaList(TbReservoirArea tbReservoirArea) {
        return tbReservoirAreaMapper.selectTbReservoirAreaList(tbReservoirArea);
    }

    /**
     * 新增库区设置
     *
     * @param tbReservoirArea 库区设置
     * @return 结果
     */
    @Override
    public int insertTbReservoirArea(TbReservoirArea tbReservoirArea) {
                                                                return save(tbReservoirArea) ? 1 : 0;
    }

    /**
     * 修改库区设置
     *
     * @param tbReservoirArea 库区设置
     * @return 结果
     */
    @Override
    public int updateTbReservoirArea(TbReservoirArea tbReservoirArea) {
                                                        return updateById(tbReservoirArea) ? 1 : 0;
    }

    /**
     * 批量删除库区设置
     *
     * @param ids 需要删除的库区设置主键
     * @return 结果
     */
    @Override
    public int deleteTbReservoirAreaByIds(Long[] ids) {
                return removeByIds(Arrays.asList(ids)) ? 1 : 0;
    }

    /**
     * 删除库区设置信息
     *
     * @param id 库区设置主键
     * @return 结果
     */
    @Override
    public int deleteTbReservoirAreaById(Long id) {
                return removeById(id) ? 1 : 0;
    }

}
